diff options
| author | Adam Soltys <[email protected]> | 2022-12-29 16:07:47 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-12-29 16:07:47 -0800 |
| commit | 97c0bf2a15a6570093b326044766d127ba950347 (patch) | |
| tree | 3406d9706990bf54b2ec86091ab5cf653416b62c /src/routes/(app)/[username]/(profile)/+layout.server.js | |
| parent | 65c1a7a3113c0fabe67d74f430254845830e1e2f (diff) | |
| download | coinos-ui-97c0bf2a15a6570093b326044766d127ba950347.tar.gz coinos-ui-97c0bf2a15a6570093b326044766d127ba950347.zip | |
catch follow errors
Diffstat (limited to 'src/routes/(app)/[username]/(profile)/+layout.server.js')
| -rw-r--r-- | src/routes/(app)/[username]/(profile)/+layout.server.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/routes/(app)/[username]/(profile)/+layout.server.js b/src/routes/(app)/[username]/(profile)/+layout.server.js index 9cd0870d..f4f2ca0a 100644 --- a/src/routes/(app)/[username]/(profile)/+layout.server.js +++ b/src/routes/(app)/[username]/(profile)/+layout.server.js @@ -3,8 +3,20 @@ import { get } from '$lib/utils'; export async function load({ parent }) { let { subject, user } = await parent(); - subject.follows = await get(`/${subject.pubkey}/follows`); - subject.followers = await get(`/${subject.pubkey}/followers`); + subject.follows = []; + subject.followers = []; + + try { + subject.follows = await get(`/${subject.pubkey}/follows`); + } catch (e) { + console.log('problem fetching follows', e); + } + + try { + subject.followers = await get(`/${subject.pubkey}/followers`); + } catch (e) { + console.log('problem fetching followers', e); + } if (user) { user.follows = await get(`/${user.pubkey}/follows?tagsonly=true`); |
